//
//	ZcoModelProfile.m
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "ZcoModelProfile.h"

NSString *const kZcoModelProfileFullName = @"fullName";
NSString *const kZcoModelProfileGender = @"gender";
NSString *const kZcoModelProfilePicture = @"picture";
NSString *const kZcoModelProfileIsRobot = @"isRobot";

@interface ZcoModelProfile ()
@end
@implementation ZcoModelProfile




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
    if(![dictionary[kZcoModelProfileIsRobot] isKindOfClass:[NSNull class]]){
        self.isRobot = [dictionary[kZcoModelProfileIsRobot] boolValue];
    }
    
	if(![dictionary[kZcoModelProfileFullName] isKindOfClass:[NSNull class]]){
		self.fullName = dictionary[kZcoModelProfileFullName];
	}	
	if(![dictionary[kZcoModelProfileGender] isKindOfClass:[NSNull class]]){
		self.gender = dictionary[kZcoModelProfileGender];
	}	
	if(![dictionary[kZcoModelProfilePicture] isKindOfClass:[NSNull class]]){
		self.picture = dictionary[kZcoModelProfilePicture];
	}	
	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	if(self.fullName != nil){
		dictionary[kZcoModelProfileFullName] = self.fullName;
	}
	if(self.gender != nil){
		dictionary[kZcoModelProfileGender] = self.gender;
	}
	if(self.picture != nil){
		dictionary[kZcoModelProfilePicture] = self.picture;
	}
    dictionary[kZcoModelProfileIsRobot] = @(self.isRobot);
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	if(self.fullName != nil){
		[aCoder encodeObject:self.fullName forKey:kZcoModelProfileFullName];
	}
	if(self.gender != nil){
		[aCoder encodeObject:self.gender forKey:kZcoModelProfileGender];
	}
	if(self.picture != nil){
		[aCoder encodeObject:self.picture forKey:kZcoModelProfilePicture];
	}
    [aCoder encodeObject:@(self.isRobot) forKey:kZcoModelProfileIsRobot];

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.fullName = [aDecoder decodeObjectForKey:kZcoModelProfileFullName];
	self.gender = [aDecoder decodeObjectForKey:kZcoModelProfileGender];
	self.picture = [aDecoder decodeObjectForKey:kZcoModelProfilePicture];
    self.isRobot = [[aDecoder decodeObjectForKey:kZcoModelProfileIsRobot] boolValue];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	ZcoModelProfile *copy = [ZcoModelProfile new];

	copy.fullName = [self.fullName copy];
	copy.gender = [self.gender copy];
	copy.picture = [self.picture copy];
    copy.isRobot = self.isRobot;
	return copy;
}
@end
